package com.cqndt.disaster.device.util;

import java.util.Calendar;
import java.text.SimpleDateFormat;

public class DateUtils {

	public static String getBeforeHour(int hour) {
		Calendar calendar = Calendar.getInstance();
		/** HOUR_OF_DAY 指示一天中的小时 */
		calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-hour);
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return df.format(calendar.getTime());
	}
	
}